using UnityEngine;
using UnityEngine.EventSystems;

public class Masse : MonoBehaviour
{
	[SerializeField]
	private int m_PrevValue;

	[SerializeField]
	private RectTransform m_Cue;

	public void OnCueDrag(BaseEventData data)
	{
		PointerEventData pointerEventData = data as PointerEventData;
		Vector3 worldPosition = pointerEventData.worldPosition;
		int value = (int)Vector3.Angle(Vector3.right, worldPosition - m_Cue.position);
		value = Mathf.Clamp(value, 0, 90);
		if (m_PrevValue != value)
		{
			m_PrevValue = value;
			m_Cue.localEulerAngles = new Vector3(0f, 0f, value);
		}
	}
}
